#include "control.hpp"
#include "main.hpp"
#include <allegro.h>
#include <iostream>

void cControl::draw(BITMAP * &bufor)
{

}

void cControl::setBgColor(int color)
{

}

cControl::cControl(int x, int y, int w, int h, char * v, int tCol, int bgCol)
{
    pos = new sPoint(x, y);
    size = new sPoint(w, h);
    value = v;
    bgColor = bgCol;
    textColor = tCol;
    show = true;
    deleted = false;
}


cControl::~cControl()
{
    delete pos;
    delete size;
}

bool cControl::isClicked()
{
    return (mouse_x >= pos->x && mouse_y >= pos->y && mouse_x < pos->x + size->x && mouse_y < pos->y + size->y && mouse_b == 1);
}
